using micromsg;
using MicroMsg.Common.Event;
using MicroMsg.Common.Utils;
using MicroMsg.Protocol;
using System;
namespace MicroMsg.Scene
{
	public class NetSceneSendVerifyEmail : NetSceneBaseEx<SendVerifyEmailRequest, SendVerifyEmailResponse, SendVerifyEmailRequest.Builder>
	{
		private const string TAG = "NetSceneSendVerifyEmail";
		public bool doScene(string userName)
		{
			base.beginBuilder();
			this.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(43);
			this.mBuilder.UserName = Util.toSKString(userName);
			this.mSessionPack.mCmdID = 43;
			base.endBuilder();
			return true;
		}
		protected override void onFailed(SendVerifyEmailRequest request, SendVerifyEmailResponse response)
		{
			Log.smethod_1("NetSceneSendVerifyEmail", "send SendVerifyEmailRequest failed");
			EventCenter.postEvent(EventConst.ON_NETSCENE_VERIFY_EMAIL_ERR, null, null);
		}
		protected override void onSuccess(SendVerifyEmailRequest request, SendVerifyEmailResponse response)
		{
			RetConst ret = (RetConst)response.BaseResponse.Ret;
			if (ret != RetConst.MM_OK)
			{
				Log.smethod_1("NetSceneSendVerifyEmail", "send SendVerifyEmailRequest failed ret =" + ret);
				EventCenter.postEvent(EventConst.ON_NETSCENE_VERIFY_EMAIL_ERR, null, null);
				return;
			}
			EventCenter.postEvent(EventConst.ON_NETSCENE_VERIFY_EMAIL_SUCCESS, null, null);
		}
	}
}
